package cn.bjc.feign;

import cn.bjc.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFallback implements FallbackFactory<UserFeignService> {
    @Override
    public UserFeignService create(Throwable throwable) {
        return new UserFeignService() {
            @Override
            public User getById(Long id) {
                return new User(-1L,"openfeign熔断了","触发openfeign熔断了");
            }
        };
    }
}
